package 工厂模式;

public class Factory {
    public Fly produce(String type) {
        if ("bird".equals(type))
            return new Bird();
        else if ("flight".equals(type))
            return new Flight();
        else
            System.out.println("please input a right type");
        return null;
    }
}
